package com.example.demo.controller.front;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.mapper.LawyerMapper;
import com.example.demo.pojo.Lawyer;
import com.example.demo.utils.LayuiResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/front/lawyer")
public class FrontLawyerController {


    @Resource
    private LawyerMapper lawyerMapper;


    @RequestMapping("/getAll")
    public Object getAll(){
        QueryWrapper<Lawyer> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status",1);
        List<Lawyer> lawyers = lawyerMapper.selectList(queryWrapper);
        Integer count = lawyerMapper.selectCount(queryWrapper);
        return LayuiResult.selectSuccess(lawyers,count);
    }


}
